#include <iostream> 
using namespace std;
int main()
{
	int n,i;
	long long sq(int);
	long long t,S;
	S = 0;
	cin>>n;
	if (n>=1 && n<=50)
	{
		for (i=n;i>=1;i--)
		{
			t = sq(i);
			S = S + t;
		}
		cout<<S<<endl;
	}
	else cout<<"Error!"<<endl;
	return 0;
}

long long sq(int a)
{
	long long i,total;
	total = 1;
	for (i=2;i<=a;i++)
	{
		total = total * i;
	}
	return total;
}
